import { defineStore } from 'pinia'
import { ref } from 'vue'

// 用户相关 定义 Store
export const useToastStore = defineStore('toast', () => {
  // 会员信息
  let show = ref<boolean>(false)
  let type: any = ref(false)
  let title = ref<string | undefined>(undefined)
  watch(show, () => {
    if (show.value) {
      setTimeout(() => {
        show.value = false
      }, 2300)
    }
  })

  // 记得 return
  return {
    show,
    title,
    type,
  }
})
